package com.lo23.data.objgroup;

import java.util.Date;

import com.lo23.data.utils.FormatConvert;
import com.lo23.data.xml.XMLData.XMLLocalUser.XMLFriendshipAnswer;
import com.lo23.data.utils.DataUtils;

public class FriendshipAnswer {
	private XMLFriendshipAnswer _friendshipAnswer;

	/**
	 * @param friendshipAnswer
	 */
	public FriendshipAnswer(XMLFriendshipAnswer friendshipAnswer) {
		_friendshipAnswer = friendshipAnswer;
	}

	/**
	 * Get the ID of the friend
	 * 
	 * @return the friendID
	 */
	public String getFriendID() {
		return DataUtils.nullString(_friendshipAnswer.getFriendId());
	}

	/**
	 * Get the ID of the friend
	 * 
	 * @return the friendLogin
	 */
	public String getFriendLogin() {
		return DataUtils.nullString(_friendshipAnswer.getFriendLogin());
	}

	/**
	 * Get the date
	 * 
	 * @return the date
	 */
	public Date getDate() {
			return FormatConvert.xMLGregorianCalendarToDate(_friendshipAnswer.getDate());
	
	}

	/**
	 * Get the answer status
	 * 
	 * @return the status
	 */
	public boolean getStatus() {
		return _friendshipAnswer.isStatut();
	}

	/**
	 * Get the result
	 * 
	 * @return the result
	 */
	public boolean getResult() {
		return _friendshipAnswer.isResult();
	}

	/**
	 * Set the ID of the friend
	 * 
	 * @param friendID
	 *            the friendID to set
	 */
	public void setFriendID(String friendID) {
		_friendshipAnswer.setFriendId(friendID);
	}

	/**
	 * Set the login of the friend
	 * 
	 * @param friendLogin
	 *            the friendLogin to set
	 */
	public void setFriendLogin(String friendLogin) {
		_friendshipAnswer.setFriendLogin(friendLogin);
	}

	/**
	 * Set the date
	 * 
	 * @param date
	 *            the date to set
	 */
	public void setDate(Date date) {
		_friendshipAnswer.setDate(FormatConvert
				.dateToXMLGregorianCalendar(date));
	}

	/**
	 * Set the answer
	 * 
	 * @param status
	 *            the status to set
	 */
	public void setStatus(boolean status) {
		_friendshipAnswer.setStatut(status);
	}

	/**
	 * Set the result of the answer
	 * 
	 * @param result
	 *            the result to set
	 */
	public void setResult(boolean result) {
		_friendshipAnswer.setResult(result);
	}

}
